\(\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx\) [312]
Optimal result
Integrand size = 31, antiderivative size = 143 \[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=-\frac {\left (2 a A b-2 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^3 d}+\frac {2 a^2 (A b-a B) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^3 \sqrt {a+b} d}+\frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d}
\]
[Out]
-1/2*(2*A*a*b-2*B*a^2-B*b^2)*arctanh(sin(d*x+c))/b^3/d+2*a^2*(A*b-B*a)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/
(a+b)^(1/2))/b^3/d/(a-b)^(1/2)/(a+b)^(1/2)+(A*b-B*a)*tan(d*x+c)/b^2/d+1/2*B*sec(d*x+c)*tan(d*x+c)/b/d
Rubi [A] (verified)
Time = 0.43 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.00, number of
steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {4118, 4167, 4083, 3855, 3916,
2738, 214} \[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\frac {2 a^2 (A b-a B) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^3 d \sqrt {a-b} \sqrt {a+b}}-\frac {\left (-2 a^2 B+2 a A b-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^3 d}+\frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \tan (c+d x) \sec (c+d x)}{2 b d}
\]
[In]
Int[(Sec[c + d*x]^3*(A + B*Sec[c + d*x]))/(a + b*Sec[c + d*x]),x]
[Out]
-1/2*((2*a*A*b - 2*a^2*B - b^2*B)*ArcTanh[Sin[c + d*x]])/(b^3*d) + (2*a^2*(A*b - a*B)*ArcTanh[(Sqrt[a - b]*Tan
[(c + d*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*b^3*Sqrt[a + b]*d) + ((A*b - a*B)*Tan[c + d*x])/(b^2*d) + (B*Sec[c +
d*x]*Tan[c + d*x])/(2*b*d)
Rule 214
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 3855
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3916
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a/b)*Si
n[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Rule 4083
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]
Rule 4118
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Simp[(-B)*d^2*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*((d*Csc[e + f*x])^(n - 2)/
(b*f*(m + n))), x] + Dist[d^2/(b*(m + n)), Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^(n - 2)*Simp[a*B*(n - 2
) + B*b*(m + n - 1)*Csc[e + f*x] + (A*b*(m + n) - a*B*(n - 1))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e
, f, A, B, m}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[n, 1] && NeQ[m + n, 0] && !IGtQ[m, 1]
Rule 4167
Int[csc[(e_.) + (f_.)*(x_)]*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_
.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m
+ 2))), x] + Dist[1/(b*(m + 2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*A*(m + 2) + b*C*(m + 1) + (b*
B*(m + 2) - a*C)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Rubi steps \begin{align*}
\text {integral}& = \frac {B \sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\int \frac {\sec (c+d x) \left (a B+b B \sec (c+d x)+2 (A b-a B) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{2 b} \\ & = \frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\int \frac {\sec (c+d x) \left (a b B-\left (2 a A b-2 a^2 B-b^2 B\right ) \sec (c+d x)\right )}{a+b \sec (c+d x)} \, dx}{2 b^2} \\ & = \frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\left (a^2 (A b-a B)\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b^3}-\frac {\left (2 a A b-2 a^2 B-b^2 B\right ) \int \sec (c+d x) \, dx}{2 b^3} \\ & = -\frac {\left (2 a A b-2 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^3 d}+\frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\left (a^2 (A b-a B)\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b^4} \\ & = -\frac {\left (2 a A b-2 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^3 d}+\frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\left (2 a^2 (A b-a B)\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = -\frac {\left (2 a A b-2 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^3 d}+\frac {2 a^2 (A b-a B) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^3 \sqrt {a+b} d}+\frac {(A b-a B) \tan (c+d x)}{b^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 b d} \\
\end{align*}
Mathematica [B] (verified)
Leaf count is larger than twice the leaf count of optimal. \(300\) vs. \(2(143)=286\).
Time = 2.07 (sec) , antiderivative size = 300, normalized size of antiderivative = 2.10
\[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\frac {\frac {8 a^2 (-A b+a B) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-2 \left (-2 a A b+2 a^2 B+b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 \left (-2 a A b+2 a^2 B+b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b^2 B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 b (A b-a B) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}-\frac {b^2 B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 b (A b-a B) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )}}{4 b^3 d}
\]
[In]
Integrate[(Sec[c + d*x]^3*(A + B*Sec[c + d*x]))/(a + b*Sec[c + d*x]),x]
[Out]
((8*a^2*(-(A*b) + a*B)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/Sqrt[a^2 - b^2] - 2*(-2*a*A*b + 2
*a^2*B + b^2*B)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 2*(-2*a*A*b + 2*a^2*B + b^2*B)*Log[Cos[(c + d*x)/2]
+ Sin[(c + d*x)/2]] + (b^2*B)/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2 + (4*b*(A*b - a*B)*Sin[(c + d*x)/2])/(C
os[(c + d*x)/2] - Sin[(c + d*x)/2]) - (b^2*B)/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 + (4*b*(A*b - a*B)*Sin[(
c + d*x)/2])/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))/(4*b^3*d)
Maple [A] (verified)
Time = 1.06 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.60
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {\frac {B}{2 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 A b -2 B a -B b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (2 A a b -2 B \,a^{2}-b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{3}}+\frac {2 a^{2} \left (A b -B a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {B}{2 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 A b -2 B a -B b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-2 A a b +2 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{3}}}{d}\) |
\(229\) |
default |
\(\frac {\frac {B}{2 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 A b -2 B a -B b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (2 A a b -2 B \,a^{2}-b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{3}}+\frac {2 a^{2} \left (A b -B a \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {B}{2 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 A b -2 B a -B b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-2 A a b +2 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{3}}}{d}\) |
\(229\) |
risch |
\(-\frac {i \left (B b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 B a \,{\mathrm e}^{2 i \left (d x +c \right )}-B b \,{\mathrm e}^{i \left (d x +c \right )}-2 A b +2 B a \right )}{d \,b^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A a}{d \,b^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,a^{2}}{d \,b^{3}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d b}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A a}{d \,b^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,a^{2}}{d \,b^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d b}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right ) A}{\sqrt {a^{2}-b^{2}}\, d \,b^{2}}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right ) B}{\sqrt {a^{2}-b^{2}}\, d \,b^{3}}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right ) A}{\sqrt {a^{2}-b^{2}}\, d \,b^{2}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right ) B}{\sqrt {a^{2}-b^{2}}\, d \,b^{3}}\) |
\(524\) |
| | |
|
|
|
[In]
int(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)
[Out]
1/d*(1/2*B/b/(tan(1/2*d*x+1/2*c)-1)^2-1/2*(2*A*b-2*B*a-B*b)/b^2/(tan(1/2*d*x+1/2*c)-1)+1/2*(2*A*a*b-2*B*a^2-B*
b^2)/b^3*ln(tan(1/2*d*x+1/2*c)-1)+2*a^2*(A*b-B*a)/b^3/((a-b)*(a+b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a
-b)*(a+b))^(1/2))-1/2*B/b/(tan(1/2*d*x+1/2*c)+1)^2-1/2*(2*A*b-2*B*a-B*b)/b^2/(tan(1/2*d*x+1/2*c)+1)+1/2/b^3*(-
2*A*a*b+2*B*a^2+B*b^2)*ln(tan(1/2*d*x+1/2*c)+1))
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 276 vs. \(2 (130) = 260\).
Time = 2.87 (sec) , antiderivative size = 609, normalized size of antiderivative = 4.26
\[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\left [-\frac {2 \, {\left (B a^{3} - A a^{2} b\right )} \sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )^{2} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - {\left (2 \, B a^{4} - 2 \, A a^{3} b - B a^{2} b^{2} + 2 \, A a b^{3} - B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (2 \, B a^{4} - 2 \, A a^{3} b - B a^{2} b^{2} + 2 \, A a b^{3} - B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (B a^{2} b^{2} - B b^{4} - 2 \, {\left (B a^{3} b - A a^{2} b^{2} - B a b^{3} + A b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{2} b^{3} - b^{5}\right )} d \cos \left (d x + c\right )^{2}}, -\frac {4 \, {\left (B a^{3} - A a^{2} b\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right )^{2} - {\left (2 \, B a^{4} - 2 \, A a^{3} b - B a^{2} b^{2} + 2 \, A a b^{3} - B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (2 \, B a^{4} - 2 \, A a^{3} b - B a^{2} b^{2} + 2 \, A a b^{3} - B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (B a^{2} b^{2} - B b^{4} - 2 \, {\left (B a^{3} b - A a^{2} b^{2} - B a b^{3} + A b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{2} b^{3} - b^{5}\right )} d \cos \left (d x + c\right )^{2}}\right ]
\]
[In]
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+b*sec(d*x+c)),x, algorithm="fricas")
[Out]
[-1/4*(2*(B*a^3 - A*a^2*b)*sqrt(a^2 - b^2)*cos(d*x + c)^2*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)
^2 + 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x +
c) + b^2)) - (2*B*a^4 - 2*A*a^3*b - B*a^2*b^2 + 2*A*a*b^3 - B*b^4)*cos(d*x + c)^2*log(sin(d*x + c) + 1) + (2*B
*a^4 - 2*A*a^3*b - B*a^2*b^2 + 2*A*a*b^3 - B*b^4)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*(B*a^2*b^2 - B*b^4
- 2*(B*a^3*b - A*a^2*b^2 - B*a*b^3 + A*b^4)*cos(d*x + c))*sin(d*x + c))/((a^2*b^3 - b^5)*d*cos(d*x + c)^2), -
1/4*(4*(B*a^3 - A*a^2*b)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x +
c)))*cos(d*x + c)^2 - (2*B*a^4 - 2*A*a^3*b - B*a^2*b^2 + 2*A*a*b^3 - B*b^4)*cos(d*x + c)^2*log(sin(d*x + c) +
1) + (2*B*a^4 - 2*A*a^3*b - B*a^2*b^2 + 2*A*a*b^3 - B*b^4)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*(B*a^2*b
^2 - B*b^4 - 2*(B*a^3*b - A*a^2*b^2 - B*a*b^3 + A*b^4)*cos(d*x + c))*sin(d*x + c))/((a^2*b^3 - b^5)*d*cos(d*x
+ c)^2)]
Sympy [F]
\[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\int \frac {\left (A + B \sec {\left (c + d x \right )}\right ) \sec ^{3}{\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx
\]
[In]
integrate(sec(d*x+c)**3*(A+B*sec(d*x+c))/(a+b*sec(d*x+c)),x)
[Out]
Integral((A + B*sec(c + d*x))*sec(c + d*x)**3/(a + b*sec(c + d*x)), x)
Maxima [F(-2)]
Exception generated. \[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+b*sec(d*x+c)),x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
for more de
Giac [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 269 vs. \(2 (130) = 260\).
Time = 0.37 (sec) , antiderivative size = 269, normalized size of antiderivative = 1.88
\[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\frac {\frac {{\left (2 \, B a^{2} - 2 \, A a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{3}} - \frac {{\left (2 \, B a^{2} - 2 \, A a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{3}} - \frac {4 \, {\left (B a^{3} - A a^{2} b\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{\sqrt {-a^{2} + b^{2}} b^{3}} + \frac {2 \, {\left (2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} b^{2}}}{2 \, d}
\]
[In]
integrate(sec(d*x+c)^3*(A+B*sec(d*x+c))/(a+b*sec(d*x+c)),x, algorithm="giac")
[Out]
1/2*((2*B*a^2 - 2*A*a*b + B*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^3 - (2*B*a^2 - 2*A*a*b + B*b^2)*log(abs(
tan(1/2*d*x + 1/2*c) - 1))/b^3 - 4*(B*a^3 - A*a^2*b)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) + arcta
n(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/(sqrt(-a^2 + b^2)*b^3) + 2*(2*B*a*tan(
1/2*d*x + 1/2*c)^3 - 2*A*b*tan(1/2*d*x + 1/2*c)^3 + B*b*tan(1/2*d*x + 1/2*c)^3 - 2*B*a*tan(1/2*d*x + 1/2*c) +
2*A*b*tan(1/2*d*x + 1/2*c) + B*b*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*b^2))/d
Mupad [B] (verification not implemented)
Time = 18.54 (sec) , antiderivative size = 4047, normalized size of antiderivative = 28.30
\[
\int \frac {\sec ^3(c+d x) (A+B \sec (c+d x))}{a+b \sec (c+d x)} \, dx=\text {Too large to display}
\]
[In]
int((A + B/cos(c + d*x))/(cos(c + d*x)^3*(a + b/cos(c + d*x))),x)
[Out]
(B*a*sin(2*c + 2*d*x))/(2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) - (A*b*sin(2*c + 2*d*x))/(2*d*(a^2 - b^2)*
(cos(2*c + 2*d*x)/2 + 1/2)) - (B*b*sin(c + d*x))/(2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) - (A*a*atan((sin
(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*1i)/(d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (B*b*atan((sin(c/2 +
(d*x)/2)*1i)/cos(c/2 + (d*x)/2))*1i)/(2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (A*a^3*atan((sin(c/2 + (d*
x)/2)*1i)/cos(c/2 + (d*x)/2))*1i)/(b^2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (B*a^2*atan((sin(c/2 + (d*x
)/2)*1i)/cos(c/2 + (d*x)/2))*1i)/(2*b*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) - (B*a^4*atan((sin(c/2 + (d*x)
/2)*1i)/cos(c/2 + (d*x)/2))*1i)/(b^3*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (A*a^2*sin(2*c + 2*d*x))/(2*b
*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) - (B*a^3*sin(2*c + 2*d*x))/(2*b^2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2
+ 1/2)) - (A*a*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x)*1i)/(d*(a^2 - b^2)*(cos(2*c
+ 2*d*x)/2 + 1/2)) + (B*b*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x)*1i)/(2*d*(a^2 - b^
2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (B*a^2*sin(c + d*x))/(2*b*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (A*a^3*
atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x)*1i)/(b^2*d*(a^2 - b^2)*(cos(2*c + 2*d*x)/2 +
1/2)) + (B*a^2*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x)*1i)/(2*b*d*(a^2 - b^2)*(cos(
2*c + 2*d*x)/2 + 1/2)) - (B*a^4*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x)*1i)/(b^3*d*(
a^2 - b^2)*(cos(2*c + 2*d*x)/2 + 1/2)) + (A*a^2*atan(((8*B^2*a^7*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(3/2) - 8*B^2*
a^9*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2) + B^2*b^9*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2) - B^2*a*b^8*sin(c/2 +
(d*x)/2)*(a^2 - b^2)^(1/2) + 4*A^2*a^2*b^7*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2) - 4*A^2*a^3*b^6*sin(c/2 + (d*x
)/2)*(a^2 - b^2)^(1/2) - 4*A^2*a^4*b^5*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2) + 8*A^2*a^5*b^2*sin(c/2 + (d*x)/2)
*(a^2 - b^2)^(3/2) + 12*A^2*a^5*b^4*sin(c/2 + (d*x)/2)*(a^2 - b^2)^(1/2) - 8*A^2*a^7*b^2*sin(c/2 + (d*x)/2)*(a
^2 - b^2)^(1/2) + 2*B^2*a^2*b^7*sin(c/2 + (d*x)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